import 'package:flutter/material.dart';

import 'package:scoped_model/scoped_model.dart';
import 'package:fluro/fluro.dart';

import 'package:flutter_popcorntime/routers/routers.dart';
import 'package:flutter_popcorntime/models/app_model.dart';
import 'package:flutter_popcorntime/pages/home_page/home_page.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  MyApp() {
    // init router
    Routers().configureRoutes(FluroRouter());
  }

  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return ScopedModel<AppModel>(
      model: AppModel(),
      child: ScopedModelDescendant<AppModel>(
        builder: (context, child, model) {
          return MaterialApp(
            debugShowCheckedModeBanner: false,
            theme: ThemeData(
              primarySwatch: Colors.blue,
            ),
            onGenerateRoute: Routers().router.generator,
            home: HomePage(),
          );
        },
      ),
    );
  }
}
